package com.example.springboot3.context;

/**
 * @author 张琪
 * @date 2024-02-26 14:42
 */
public class UserContext {
    private static final ThreadLocal<String> USER = new ThreadLocal<>();

    public static void add(String username){
        USER.set(username);
    }

    public static String get(){
        return USER.get();
    }

    public static void remove(){
        USER.remove();
    }
}
